package com.ziyueyuwen.xiniao.bean.product;

import com.ziyueyuwen.xiniao.util.DateUtil;

import java.util.Date;

/**
 * Created by wancheng on 2019/4/9.
 */
public class SaleDateParam {

    private String beginTime;

    private String endTime;

    public SaleDateParam(Date beginTime, Date endTime) {
        this.beginTime = DateUtil.date2Str(beginTime,"HH:mm");
        this.endTime = DateUtil.date2Str(endTime,"HH:mm");
    }

    public SaleDateParam(String beginTime, String endTime) {
        this.beginTime = beginTime;
        this.endTime = endTime;
    }

    public String getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(String beginTime) {
        this.beginTime = beginTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SaleDateParam that = (SaleDateParam) o;

        if (!beginTime.equals(that.beginTime)) return false;
        return endTime.equals(that.endTime);

    }

    @Override
    public int hashCode() {
        int result = beginTime.hashCode();
        result = 31 * result + endTime.hashCode();
        return result;
    }
}
